package com.uade.servlets;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.annotation.WebServlet;

import com.uade.business.BusinessDelegate;
import com.uade.business.BusinessDelegateImpl;
import com.uade.model.Articulo;
import com.uade.model.Usuario;
import com.uade.model.exceptions.LoginException;
import com.uade.model.exceptions.NotFoundException;

/**
 * Servlet implementation class CerrarSesionSrv
 */
@WebServlet("/CerrarSesionSrv")
public class CerrarSesionSrv extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public CerrarSesionSrv() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub		
			response.setContentType("text/html");
	
			request.getSession().invalidate();
			
			RequestDispatcher dispatcher = request.getRequestDispatcher("/Login.jsp");
			request.setAttribute("msg", "Se ha desconectado exitosamente.");
			dispatcher.forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response)	{
	}

}
